package com.vito.dcs.water.waterGradation.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.base.factory.IDFactory;
import com.vito.base.model.DataGrid;
import com.vito.dcs.water.waterGradation.dao.WaterGradationMapper;
import com.vito.dcs.water.waterGradation.model.WaterGradationModel;
import com.vito.dcs.water.waterGradation.service.WaterGradationService;

/**
 * 水稳站筛孔合成级配统计
 * @author lyhao
 *
 */
@Service
public class WaterGradationServiceImpl implements WaterGradationService {
	
	@Autowired
	private WaterGradationMapper waterGradationMapper;
	
	@Override
	public int save(WaterGradationModel waterGradationModel){
		return waterGradationMapper.save(waterGradationModel);
	}
	@Override
	public DataGrid<WaterGradationModel> queryAllByPage(WaterGradationModel waterGradationModel){
		DataGrid<WaterGradationModel> dg = new DataGrid<WaterGradationModel>();
		dg.setRows(waterGradationMapper.queryAllByPage(waterGradationModel));
		dg.setTotal(waterGradationModel.getTotal());
		return dg;
	}
	@Override
	public WaterGradationModel query(WaterGradationModel waterGradationModel){
		return waterGradationMapper.query(waterGradationModel);
	}
	@Override
	public Integer update(WaterGradationModel waterGradationModel){
		return waterGradationMapper.update(waterGradationModel);
	}
	
	@Override
	public Integer delete(WaterGradationModel waterGradationModel){
		return waterGradationMapper.delete(waterGradationModel);
	}

    @Override
	public int saveWaterGradation(WaterGradationModel waterGradationModel){
	    waterGradationModel.setId(IDFactory.getIDFactory().getIdInc()+"");                                                            
		return save(waterGradationModel);
	}
	@Override
	public List<Map<String, String>> queryChartData(Map<String, String> map) {
		return waterGradationMapper.queryChartData(map);
	}
}